﻿--修改员工档案
CREATE proc [dbo].[proc_Employee_Update]
(
	@EName nvarchar(20),
	@ZhiWu nvarchar(50),
	@Sex nvarchar(10),
	@Birthday nvarchar(20),
	@MobilePhone nvarchar(30),
	@Email nvarchar(50),
	@IDcard nvarchar(30),
	@Address nvarchar(200),
	@Education nvarchar (30),
	@WorkYM nvarchar(50),
	@Marriage nvarchar(50),
	@PoliticsStatus nvarchar(50),
	@Cuenta nvarchar(50),
	@UpName nvarchar(20),
	@id INT,
	@Nation NVARCHAR(20),
	@ShenGao INT,
	@BloodType NVARCHAR(10),
	@YXZY NVARCHAR(50),
	@SkillName NVARCHAR(50),
	@NativeP NVARCHAR(50),
	@OEName NVARCHAR(20),
	@QQNumber NVARCHAR(50),
	@ForeignLanguage NVARCHAR(50),
	@DriveType NVARCHAR(20),
	@Hobby NVARCHAR(50),
	@WageCardNo varchar(50),
	@IsCore bit,
	@ZhiWuId int,
	@ContractEndDate datetime
)
as
	update Employee set 
	             EName = @EName,
                 Sex = @Sex,
                 Birthday = @Birthday,
                 MobilePhone = @MobilePhone,
                 Email = @Email,
                 IDcard = @IDcard,
                 Address = @Address,
                 Education = @Education,
			     WorkYM = @WorkYM,
				 Marriage =@Marriage,
				 PoliticsStatus=@PoliticsStatus,
				 Cuenta=@Cuenta,
                 UpName = @UpName,
                 ZhiWu = @ZhiWu,  
                 UpTime = getdate(),
                 OldEName = @OEName,
                 Nation = @Nation,
                 ShenGao = @ShenGao,
                 BloodType = @BloodType,
                 YXZY = @YXZY,
                 SkillName = @SkillName,
                 NativePlace = @NativeP,
                 QQ = @QQNumber,
                 ForeignLanguage = @ForeignLanguage,
                 DriveType = @DriveType,
				 Hobby = @Hobby,
				 WageCardNo=@WageCardNo,
				 IsCore = @IsCore,
				 ZhiWuId=@ZhiWuId,
				 ContractEndDate=@ContractEndDate
	where id = @id
	
	DECLARE @usname VARCHAR(20)
	SELECT @usname=UserName FROM Employee WHERE  id=@id
	UPDATE [aspnet_Users] SET Name = @EName WHERE UserName=@usname